import psycopg2

con = psycopg2.connect(database="test", user="postgres", password="123qweasd", host="192.168.28.91", port="5432")

cur = con.cursor()

vals = [{"Id":5, "Name":"fsdfsdf", "Age": 10, "Address": "fsdfsdf", "Salary": 123123},
{"Id":6, "Name":"33", "Age": 130, "Address": "32dfg", "Salary": 234}]

cur.executemany("INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) \
   VALUES (%(Id)s, %(Name)s, %(Age)s, %(Address)s, %(Salary)s)", vals);

cur.execute("SELECT id, name, address, salary  from COMPANY")

rows = cur.fetchall()

for row in rows:
   print("ID = ", row[0])
   print("NAME = ", row[1])
   print("ADDRESS = ", row[2])
   print("SALARY = ", row[3], "\n")



con.commit()

con.close()

